package com.serkol.ams.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.serkol.ams.bean.MyPage;
import com.serkol.ams.bean.MyPageOld;
import com.serkol.ams.bean.OrderUserShenheParam;
import com.serkol.ams.entity.OrderDetail;
import com.serkol.ams.entity.OrderMaster;
import com.serkol.exception.AuthException;
import com.serkol.exception.SucsessException;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author pingan
* @description 针对表【order_master】的数据库操作Service
* @createDate 2022-12-03 00:16:38
*/
public interface OrderMasterService extends IService<OrderMaster> {


    Map<String, Object> myOrderStastica(Date startDate, Date endDate);

    Map<String, Object> teamOrderStastica(Date startDate, Date endDate);

    MyPage<Map<String, Object>> findByPageList(int pageSize, int page, int type, int paymentMethod, int paymentStatus, String userName, String sn, String partySn);

    boolean saveAgentOrderDetails(OrderMaster order, List<OrderDetail> orderDetails, long agentId) throws AuthException, SucsessException;

    boolean saveAgentOrderCreateDetails(OrderMaster order, List<OrderDetail> orderDetails) throws AuthException, AuthException, SucsessException;

    Map<String, Object> getInfo();

    List<Map<String, Object>> findByMyList(int status);

    OrderMaster getBySn(String outTradeNo);

    OrderMaster findById(long orderId);
    Map<String,Object> findMapById(long orderId);


    Map<String, Object> getUsersStastic();

    boolean savecloudDeliveryOrderDetails(OrderMaster orderMaster);

    boolean saveShenheOrderDetails(OrderMaster orderMaster, List<OrderUserShenheParam> datas);

    boolean saveOrderCreate(OrderMaster order, List<OrderDetail> byOrderDetailList) throws AuthException, SucsessException;

    boolean findAutoUpdate();
    boolean findAutoByUpdate(long userId);

    Map<String, Object> myWalletStastica(long userId);

    boolean agentDanTarget(OrderMaster orderMaster, List<OrderDetail> byOrderDetailList);

    List<Map<String, Object>> homeOrderChartStastic();

    Map<String, Object> info(long id);
}
